package com.cy.service.impl;

import com.cy.dao.AccountDao;
import com.cy.service.AccountService;
import org.springframework.stereotype.Service;

import javax.annotation.PostConstruct;
import javax.annotation.PreDestroy;
import javax.annotation.Resource;
import java.util.Date;

/**
 * @Author : 残影
 * @Date: 2021-03-09 10:42
 */
@Service("accountService")
public class AccountServiceImpl implements AccountService {
    //@Autowired
    //@Qualifier("accountDao1")
    @Resource(name = "accountDao2")
    private AccountDao accountDao;

    @PostConstruct
    public void  init(){
        System.out.println("初始化方法执行了");
    }

    @PreDestroy
    public void  destroy(){
        System.out.println("销毁方法执行了");
    }

    @Override
    public void  saveAccount(){
        accountDao.saveAccount();
    }
}
